﻿using Knight.Models.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using WebApp.Infrastructure.WorkContext;
using Knight.Models.Services;
using Knight.Models.Entity;

namespace WebApp.Controllers
{
    public class BaseWebController : BaseController
    {
        public WebWorkContext WorkContext = new WebWorkContext();

        protected override void Initialize(RequestContext requestContext)
        {
            base.Initialize(requestContext);
            this.ValidateRequest = false;    
            WorkContext.Url = requestContext.HttpContext.Request.Url.PathAndQuery.ToLower();
            WorkContext.UrlReferrer = requestContext.HttpContext.Request.UrlReferrer == null ? "" : requestContext.HttpContext.Request.UrlReferrer.ToString().ToLower();
        }
    }
}